#ifndef MYPAINTER_H
#define MYPAINTER_H

#include <QWidget>
#include<QPen>
#include<QBrush>
class mypainter : public QWidget
{
    Q_OBJECT
public:
    explicit mypainter(QWidget *parent = nullptr);

   enum shape{Line,//值为0
              Rectangle//值为1
             };
   void setPen(QPen p);
   void setBrush(QBrush brs);
   void paintEvent(QPaintEvent *event);
   void setShape(shape s);
    void setfillrule(Qt::FillRule rle);
private:
    QPen pen;
    QBrush brush;
    shape syp;
    Qt::FillRule fillrle;


signals:

};

#endif // MYPAINTER_H
